
package cn.fuxi2022.accounts.properties;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
@Data
public class ConstantPropertiesUtil implements InitializingBean {

    @Value("${wx.mp.app_id}")
    private String appid;

    @Value("${wx.mp.app_secret}")
    private String appsecret;

    @Value("${wx.mp.message.orderProgressNotification}")
    private String orderProgressNotification;

    @Value("${wx.mp.message.registerNotice}")
    private String registerNotice;

    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;

    /**
     * 订单进度通知（成功或失败） 消息模板
     */
    public static String ORDERP_ROGRESS_NOTIFICATION;

    /**
     * 签到通知 消息模板
     */
    public static String REGISTER_NOTICE;

    @Override
    public void afterPropertiesSet() throws Exception {
        ACCESS_KEY_ID = appid;
        ACCESS_KEY_SECRET = appsecret;
        ORDERP_ROGRESS_NOTIFICATION = orderProgressNotification;
        REGISTER_NOTICE = registerNotice;
    }
}